package org.burning.crm.workbench.service;

import org.burning.crm.workbench.domain.*;

import java.util.List;
import java.util.Map;

public interface TranService {
    void saveCreateTran(Map<String, Object> map);

    Tran queryTranForDetailById(String id);

    List<FunnelVO> queryCountOfTranGroupByStage();

    List<Tran> queryTranByCustomerId(String id);

    List<Tran> queryTranByContactsId(String id);

    int deleteTranById(String id);

    List<Tran> queryTranByConditionForPage(Map<String, Object> map);

    int queryCountOfTranByCondition(Map<String, Object> map);

    int deleteTranByIds(String[] id);

    Tran queryTranById(String id);

    List<Pie> queryCountOfTranGroupByStage1();

    List<Bar> queryCountOfTranGroupByStage2();

    List<Line> queryCountOfTranGroupByStage3();


    List<Pie> queryCountOfTranGroupBySource();

    List<Bar> queryCountOfTranGroupByTotalsales();

    //void updateTran(Map<String, Object> map);

    /**
     * 获取交易的总金额和每单平均金额
     * @return 总金额、每单平均金额的list
     */
    List<Map<String, Object>> getTranMoneyAllAndAvg();

    /**
     * 查询获取各个交易来源的数量
     * @return
     */
    List<Map<String, Object>> getTranAllSourceOfCount();

    /**
     * 所有者负责的单数、转换成交易的数量
     * @return
     */
    List<Map<String, Object>> getOwnerTranNum();

    void updateTran(Map<String, Object> map);

    /**
     * 市场活动统计信息
     * @return List<Map> 结构：市场活动名称 -> [联系人数量, 线索数量]
     */
    List<Map<String, Object>> getActivityChart();
}
